float boxRotation = 0;

void setup() { 
  smooth();

  fill(255);
  stroke(255);

  rectMode(CENTER);
}

void draw() {
  background ( round((mouseY/height) * 255), 100, 0 );

  boxRotation = boxRotation + ((float)(pmouseX - mouseX)/100);

  // Ball, Stick
  line( width/2, height/2, mouseX, mouseY );
  ellipse ( mouseX, mouseY, 40, 40 );

  // Box
  pushMatrix();

  translate (width/2, height/2);
  rotate(boxRotation);
  rect(0, 0, 150, 150);

  popMatrix();
}


